package cn.abellflower.flowerhomehandler.home.enums;

import cn.abellflower.flowerhomehandler.home.service.HomeService;
import cn.abellflower.flowerhomehandler.home.service.impl.HisHomeServiceImpl;
import cn.abellflower.flowerhomehandler.home.service.impl.MyHomeServiceImpl;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/**
 * @Description
 * @Author gbzdyf@126.com
 * @Date 2020/10/23 1:24 上午
 */
public enum HomeEnum {

    /**
     * 首页描述
     */
    MY_HOME("MY", "myHomeServiceImpl", HomeService.class, "MyHome描述"),
    HIS_HOME("HIS", "hisHomeServiceImpl", HisHomeServiceImpl.class, "HisHome描述");

    private String key;
    public String val;
    private String desc;

    private Class c;

    public static final Map<String, HomeEnum> HOME_ENUM_MAP;

    static {
        HomeEnum[] values = values();
        Map<String, HomeEnum> mp = new HashMap<>(values.length);

        for (HomeEnum value : values) {
            mp.put(value.getKey(), value);
        }
        HOME_ENUM_MAP = Collections.unmodifiableMap(mp);
    }

    HomeEnum(String key, String val, Class c, String desc) {
        this.key = key;
        this.val = val;
        this.c = c;
        this.desc = desc;
    }

    public String getKey() {
        return key;
    }

    public String getVal() {
        return val;
    }

    public String getDesc() {
        return desc;
    }

    public Class getC() {
        return c;
    }
}
